package com.iptv.grape.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;

/****
 *     tvScroll.startScroll();开始滚动
 *     tvScroll.stopScroll(); 停止滚动
 */
@SuppressLint("AppCompatCustomView")
public class AlwaysMarqueeTextView2 extends TextView{


    public AlwaysMarqueeTextView2(Context context) {
        super(context);
        this.setEllipsize(TextUtils.TruncateAt.END);
    }

    public AlwaysMarqueeTextView2(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.setEllipsize(TextUtils.TruncateAt.END);
    }

    public AlwaysMarqueeTextView2(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        this.setEllipsize(TextUtils.TruncateAt.END);
    }
    public void setIsFocused(boolean isFocused){
        if(isFocused)
             this.setEllipsize(TextUtils.TruncateAt.MARQUEE );
        else
            this.setEllipsize(TextUtils.TruncateAt.END);
    }
    @Override
    public boolean isFocused() {
        return true;
    }
}
